from django.contrib import admin
from models import Location
from models import Job
from models import Person
from models import PersonJob
class LocationAdmin(admin.ModelAdmin):
    list_display = ['city', 'state','country']
    
class JobAdmin(admin.ModelAdmin):
    list_display = ("job_title", "location", "pub_date")
    search_fields = ("job_title", "job_description")
    list_filter = ("location",)	
    ordering = ['-pub_date']

class PersonAdmin(admin.ModelAdmin):
    list_display = ['name']

class PersonJobAdmin(admin.ModelAdmin):
    list_display = ("person","job")
    list_filter = ("job",)	

admin.site.register(PersonJob,PersonJobAdmin)
admin.site.register(Person,PersonAdmin)
admin.site.register(Location, LocationAdmin)
admin.site.register(Job,JobAdmin)
